package com.potenza.training.resume.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.potenza.training.resume.dao.ResumeHopeStatusDao;
import com.potenza.training.resume.entity.ResumeHopeStatus;
import com.potenza.training.resume.service.ResumeHopeStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("resumeHopeStatusServiceImpl")
public class ResumeHopeStatusServiceImpl extends ServiceImpl<ResumeHopeStatusDao, ResumeHopeStatus> implements ResumeHopeStatusService {

    @Autowired
    ResumeHopeStatusDao resumeHopeStatusDao;

    @Override
    public List<ResumeHopeStatus> findAll(Integer userId) {
        QueryWrapper<ResumeHopeStatus> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(ResumeHopeStatus::getResumeId,userId);
        return resumeHopeStatusDao.selectList(queryWrapper);
    }

    @Override
    public void saveResumeHopeStatus(ResumeHopeStatus resumeHopeStatus) {
        resumeHopeStatusDao.insert(resumeHopeStatus);
    }

    @Override
    public void updateResumeHopeStatus(ResumeHopeStatus resumeHopeStatus) {
        resumeHopeStatusDao.updateById(resumeHopeStatus);
    }
}